<!DOCTYPE html>
<html>
<head>
	<!-- Google Tag Manager -->
	<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
	new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
	'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
	})(window,document,'script','dataLayer','GTM-W8KNPT4');</script>
	<!-- End Google Tag Manager -->
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width,inital-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
	<meta name="format-detection" content="telephone=no">
    <title>博猫体育 - 以太坊ETH买彩票</title>
    <link rel="stylesheet" href="css/app.min.css?ver=1.0.000">
    <link rel="stylesheet" href="css/iconfont.css?ver=1.0.000">
    <script src="js/template7.min.js"></script>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
    <script src="js/templateHelper.js"></script>
    <script src="js/order.min.js"></script>
    <script src="js/pageLib.js"></script>
</head>
<body>
<div class="header">
	<div class="nav">
		<div class="title">博猫体育</div>
		<a href="me.html" class="left-btn"><i class="iconfont icon-geren icon-large"></i></a>
		<a class="right-btn login-bar" href="login.html">登录 / 注册</a>
		<div class="right-btn user-info-bar" style="display:none;">
			<div class="login flexer">
				<div class="balance">
					<div>余额</div>
					<div>￥888.88</div>
				</div>
				<div class="deposit"><a href="deposit.html">充值</a></div>
			</div>
		</div>
	</div>
	<!-- <ul class="navgation flexer">
		<li><a class="active" href="#">彩票</a></li>
		<li><a href="#">比分</a></li>
		<li><a href="#">数据</a></li>
	</ul> -->
</div>
<!-- Promotion Position start -->
<style>
a.slider{
	display: block;
	padding-top: 45px;
}
a.slider > img{
	width: 100%;
}
</style>
<a href="/promotion/prom_2019.html" class="slider">
	<img src="promotion/images/index_slider.png">
</a>
<!-- Promotion Position end -->
<div class="table-content" style="padding-top:0px;">
	<a href="deposit.html" class="tips">
		<span>公告</span>
		<p>博猫已支持以太坊ETH充值提款</p>
		<i class="iconfont icon-xiayibu"></i>
	</a>
	<div class="preload-indicator">
		<span class="preloader"></span>
		<div>正在加载对阵列表...</div>
	</div>
	<!-- 
	<div class="collapser unfold"><a href="javascript:;">2019年01月29日 周二</a></div	>
	<ul class="list arbitrage-list sporttery-list">
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>非<br>让<br>球</td>
									<td>主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td class="chosen">客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="negative-handicap">让<br>球</td>
									<td colspan="3">未开售</td>
								</tr>
								<tr>
									<td class="negative-handicap">主<br>-1</td>
									<td>主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td class="chosen">客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="positive-handicap">主<br>+1</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td>客胜<span class="odds">6.81</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td class="chosen">客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="positive-handicap">+1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td class="chosen">平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td>客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="negative-handicap">-1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td class="chosen">平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td>客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="positive-handicap">+1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td>平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td>客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="positive-handicap">+1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td>平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
	</ul>
	<div class="collapser unfold"><a href="javascript:;">2019年01月20日 周三</a></div	>
	<ul class="list arbitrage-list sporttery-list">
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td>主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td class="chosen">客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="negative-handicap">-1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td>平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td class="chosen">客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="positive-handicap">+1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td class="chosen">平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td>客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="negative-handicap">-1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td class="chosen">平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td>客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="positive-handicap">+1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td>平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
		<li class="content-card">
			<div class="match-card flexer">
				<div class="intro">
					<p>周一001</p>
					<p>英超联赛</p>
					<p>23:59截止</p>
				</div>
				<div class="main-panel">
					<div class="match-against">
						<span class="home">曼联</span>
						<span class="against">vs</span>
						<span class="away">阿仙奴</span>
					</div>
					<div class="bet-table">
						<table>
							<tbody>
								<tr>
									<td>0</td>
									<td class="chosen">主胜<span class="odds">1.13</span></td>
									<td>平手<span class="odds">4.30</span></td>
									<td>客胜<span class="odds">6.81</span></td>
								</tr>
								<tr>
									<td class="positive-handicap">+1</td>
									<td>主胜<span class="odds">2.13</span></td>
									<td>平手<span class="odds">3.20</span></td>
									<td>客胜<span class="odds">2.21</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</li>
	</ul>
	 -->
</div>
<div class="sporttery-choose-bar bottomBar flexer">
	<div class="flexer">
		<div class="clear">
			<a href="javascript:;" class="clear-btn"><i class="iconfont icon-shanchu icon-middle"></i><span>清空</span></a>
		</div>
		<div class="status">
			<div class="chosen">已选择 <b>0</b> 场比赛</div>
			<div class="tips">请至少选择2场比赛</div>
		</div>
	</div>
	<div class="flex-to-right">
		<a class="submit-btn disable" href="javascript:;">选好了</a>
	</div>
</div>
</body>
<script type="text/javascript">
$(document).ready(function(){
	pageLib.initAffiliate();
	// 只有从确认订单页面返回的，才加载本地存储的订单数据
	if(document.referrer.substr(document.referrer.lastIndexOf('/')+1)=="confirm-order.html"){
		order.load();
	}
	pageLib.loadUserInfo();
	var baseURL='http://api.bybrain.cn';
	var toBindEventAfterRender=function(){
		// 绑定按日展开、折叠事件
		$('div.collapser').on('click',function(e){
			var target=$(this);
			var draw=target.data('draw');
			if(target.hasClass('unfold')){
				// console.log('collapse');
				target.removeClass('unfold');
				target.next('.sporttery-list').slideUp(300);
			}
			else{
				// console.log('fold');
				target.addClass('unfold');
				target.next('.sporttery-list').slideDown(300);
			}
		});
		// 选择投注项事件
		$('.bet-table td.selection').on('click',function(e){
			if(order.getCountOfMatch()>=8)return;
			var target=$(this);
			var matchid=target.parents('.content-card').data('matchid');
			var matchkey=target.parents('.content-card').data('matchkey');
			var matchtime=target.parents('.content-card').data('matchtime');
			var handicap=target.parents('.content-card').data('handicap');
			var odds=target.children('span.odds').data('odds');
			var playtype=target.parent().data('playtype');
			var selection=target.data('selection');
			var draw=target.parents('ul.sporttery-list').data('draw');
			if(target.hasClass('chosen')){
				console.log('Remove: '+matchid+','+playtype+','+selection+','+odds);
				order.remove(matchid,playtype,selection);
				target.removeClass('chosen');
			}
			else{
				console.log('Choose: '+matchid+','+playtype+','+selection+','+odds);
				order.choose(matchid,matchtime,matchkey,draw,handicap,playtype,selection,odds);
				target.addClass('chosen');
			}
			// 更新选择场次数
			var numberOfMatch=order.getCountOfMatch();
			$('.sporttery-choose-bar .chosen > b').text(numberOfMatch);
			var submitBtn=$('.sporttery-choose-bar .submit-btn');
			if(numberOfMatch>=2){
				submitBtn.removeClass('disable');
			}
			else{
				if(!submitBtn.hasClass('disable'))submitBtn.addClass('disable');
			}
		});
		// 绑定清空按钮事件
		$('.sporttery-choose-bar .clear-btn').on('click',function(e){
			// 遍历取消所有选项
			$('.bet-table td.selection.chosen').each(function(index,ele){
				$(ele).click();
			});
			// 清空本地存储里的订单信息
			order.clear();
		});
		//绑定提交按钮
		$('.sporttery-choose-bar .submit-btn').on('click',function(e){
			if($(this).hasClass('disable'))return;
			// pageLib.alert('提交订单');
			if(order.submit()){
				window.location.href="confirm-order.html";
			}
		});
		// 初始化选项
		for(var i in order.orderObject._content_obj){
			for(var j in order.orderObject._content_obj[i].betContent){
				var matchid=order.orderObject._content_obj[i].matchid;
				var playtype='';
				var selectionName='';
				switch(order.orderObject._content_obj[i].betContent[j].playtypeid){
					case order.PLAYTYPEID.SPF:
						playtype='had';
						break;
					case order.PLAYTYPEID.RQSPF:
						playtype='hhad';
						break;
					case order.PLAYTYPEID.JQS:
						// playtype='had';
						// break;
					case order.PLAYTYPEID.BF:
						// playtype='had';
						// break;
					case order.PLAYTYPEID.BQC:
						// playtype='had';
						// break;
					default:
				}
				switch(order.orderObject._content_obj[i].betContent[j].selection){
					case order.SELECTION.HOMEWIN:
						selectionName='homewin';
						break;
					case order.SELECTION.DRAW:
						selectionName='draw';
						break;
					case order.SELECTION.AWAYWIN:
						selectionName='awaywin';
						break;
					default:
				}
				var selectionBtn=$('.sporttery-list li[data-matchid='+matchid+'] tr[data-playtype='+playtype+'] td.selection[data-selection='+selectionName+']');
				if(!selectionBtn.hasClass('chosen')){
					selectionBtn.click();
				};
			}
		}
	};
	var ajaxSuccessFunc=function(resp){
		if(resp.status==200&&resp.code==1){
			console.log(resp.data);
			localStorage.setItem('matchlist',JSON.stringify(resp));
			var itemHtml=TplHelper.renderTplById('sporttery-list-item',resp);
			$('.table-content').html(itemHtml);
			toBindEventAfterRender();
		}
		else{
			console.error(resp.message);
		}
	};
	// $.ajax({
	// 	url:baseURL+'/v1/app/get-play-list',
	// 	type:'get',
	// 	data:{
	// 		day:'2019-2-2'
	// 	},
	// 	dataType:'json',
	// 	success:ajaxSuccessFunc
	// });
	pageLib.api({
		action: '/v1/app/get-play-list',
		success: ajaxSuccessFunc
	});
});
</script>
<script id="sporttery-list-item" type="text/template7">
<a href="deposit.html" class="tips">
	<span>公告</span>
	<p>博猫已支持以太坊ETH充值提款</p>
	<i class="iconfont icon-xiayibu"></i>
</a>
{{#each data}}
<div class="collapser unfold" data-draw="{{draw}}"><a href="javascript:;">{{formatDrawDate draw}}</a></div	>
<ul class="list arbitrage-list sporttery-list" data-draw="{{draw}}">
	{{#each data}}
	<li class="content-card" data-matchid="{{id}}" data-matchkey="{{matchkey}}" data-matchtime="{{matchtime}}" data-handicap="{{hhad.Handicap}}">
		<div class="match-card flexer">
			<div class="intro">
				<p>{{matchkeycn}}</p>
				<p>{{leaguenameabbr}}</p>
				<p>{{formatCloseTime closetime}}截止</p>
			</div>
			<div class="main-panel">
				<div class="match-against">
					<span class="home">{{home.teamnameabbr}}</span>
					<span class="against">vs</span>
					<span class="away">{{away.teamnameabbr}}</span>
				</div>
				<div class="bet-table">
					<table>
						<tbody>
							{{#if had.homewin}}
							<tr data-playtype="had">
								<td>非<br>让<br>球</td>
								<td class="selection" data-selection="homewin">主胜<span class="odds" data-odds="{{had.homewin}}">{{formatOdds had.homewin}}</span></td>
								<td class="selection" data-selection="draw">平手<span class="odds" data-odds="{{had.draw}}">{{formatOdds had.draw}}</span></td>
								<td class="selection" data-selection="awaywin">客胜<span class="odds" data-odds="{{had.awaywin}}">{{formatOdds had.awaywin}}</span></td>
							</tr>
							{{else}}
							<tr>
								<td>非<br>让<br>球</td>
								<td colspan="3">未开售</td>
							</tr>
							{{/if}}
							{{#if hhad.homewin}}
							<tr data-playtype="hhad">
								{{#js_if "parseFloat(this.hhad.Handicap)>0"}}
								<td class="positive-handicap">主<br>{{formatHandicap hhad.Handicap}}</td>
								{{else}}
								<td class="negative-handicap">主<br>{{formatHandicap hhad.Handicap}}</td>
								{{/js_if}}
								<td class="selection" data-selection="homewin">主胜<span class="odds" data-odds="{{hhad.homewin}}">{{formatOdds hhad.homewin}}</span></td>
								<td class="selection" data-selection="draw">平手<span class="odds" data-odds="{{hhad.draw}}">{{formatOdds hhad.draw}}</span></td>
								<td class="selection" data-selection="awaywin">客胜<span class="odds" data-odds="{{hhad.awaywin}}">{{formatOdds hhad.awaywin}}</span></td>
							</tr>
							{{else}}
							<tr>
								<td class="negative-handicap">让<br>球</td>
								<td colspan="3">未开售</td>
							</tr>
							{{/if}}
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</li>
	{{/each}}
</ul>
{{/each}}
</script>
</html>